import {
	Spin
} from 'antd';

export default class CenterSpin extends React.Component {
	render() {
		const {
			loading,
			size,
		} = this.props;

		const style = {
			position: 'absolute',
			top: '50%',
			left: '50%',
			marginLeft: -8,
			marginTop: -8,
		}

		if (size === 'large') {
			Object.assign(style, {
				marginLeft: -16,
				marginTop: -16,
			});
		}

		return (
			<div style={style}>
				<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@9bvrih`} spinning={true} size={size}></Spin>
			</div>
		)

	}
}